home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / math / gle-3.000 / gle-3 / gle / util / contour / f2c.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-07  |  4.0 KB  |  211 lines

  1. /* f2c.h  --  Standard Fortran to C header file */
  2.  
  3. /**  barf  [ba:rf]  2.  "He suggested using FORTRAN, and everybody barfed."
  4.  
  5.     - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
  6.  
  7. #include "int32.h"
  8. #ifndef F2C_INCLUDE
  9. #define F2C_INCLUDE
  10.  
  11. typedef int32 integer;
  12. typedef char *address;
  13. typedef short int shortint;
  14. typedef float real;
  15. typedef double doublereal;
  16. typedef struct { real r, i; } complex;
  17. typedef struct { doublereal r, i; } doublecomplex;
  18. typedef int32 logical;
  19. typedef short int shortlogical;
  20.  
  21. #define TRUE_ (1)
  22. #define FALSE_ (0)
  23.  
  24. /* Extern is for use with -E */
  25. #ifndef Extern
  26. #define Extern extern
  27. #endif
  28.  
  29. /* I/O stuff */
  30.  
  31. #ifdef f2c_i2
  32. /* for -i2 */
  33. typedef short flag;
  34. typedef short ftnlen;
  35. typedef short ftnint;
  36. #else
  37. typedef int32 flag;
  38. typedef int32 ftnlen;
  39. typedef int32 ftnint;
  40. #endif
  41.  
  42. /*external read, write*/
  43. typedef struct
  44. {    flag cierr;
  45.     ftnint ciunit;
  46.     flag ciend;
  47.     char *cifmt;
  48.     ftnint cirec;
  49. } cilist;
  50.  
  51. /*internal read, write*/
  52. typedef struct
  53. {    flag icierr;
  54.     char *iciunit;
  55.     flag iciend;
  56.     char *icifmt;
  57.     ftnint icirlen;
  58.     ftnint icirnum;
  59. } icilist;
  60.  
  61. /*open*/
  62. typedef struct
  63. {    flag oerr;
  64.     ftnint ounit;
  65.     char *ofnm;
  66.     ftnlen ofnmlen;
  67.     char *osta;
  68.     char *oacc;
  69.     char *ofm;
  70.     ftnint orl;
  71.     char *oblnk;
  72. } olist;
  73.  
  74. /*close*/
  75. typedef struct
  76. {    flag cerr;
  77.     ftnint cunit;
  78.     char *csta;
  79. } cllist;
  80.  
  81. /*rewind, backspace, endfile*/
  82. typedef struct
  83. {    flag aerr;
  84.     ftnint aunit;
  85. } alist;
  86.  
  87. /* inquire */
  88. typedef struct
  89. {    flag inerr;
  90.     ftnint inunit;
  91.     char *infile;
  92.     ftnlen infilen;
  93.     ftnint    *inex;    /*parameters in standard's order*/
  94.     ftnint    *inopen;
  95.     ftnint    *innum;
  96.     ftnint    *innamed;
  97.     char    *inname;
  98.     ftnlen    innamlen;
  99.     char    *inacc;
  100.     ftnlen    inacclen;
  101.     char    *inseq;
  102.     ftnlen    inseqlen;
  103.     char     *indir;
  104.     ftnlen    indirlen;
  105.     char    *infmt;
  106.     ftnlen    infmtlen;
  107.     char    *inform;
  108.     ftnint    informlen;
  109.     char    *inunf;
  110.     ftnlen    inunflen;
  111.     ftnint    *inrecl;
  112.     ftnint    *innrec;
  113.     char    *inblank;
  114.     ftnlen    inblanklen;
  115. } inlist;
  116.  
  117. #define VOID void
  118.  
  119. union Multitype {    /* for multiple entry points */
  120.     shortint h;
  121.     integer i;
  122.     real r;
  123.     doublereal d;
  124.     complex c;
  125.     doublecomplex z;
  126.     };
  127.  
  128. typedef union Multitype Multitype;
  129.  
  130. typedef int32 Long;
  131.  
  132. struct Vardesc {    /* for Namelist */
  133.     char *name;
  134.     char *addr;
  135.     Long *dims;
  136.     int  type;
  137.     };
  138. typedef struct Vardesc Vardesc;
  139.  
  140. struct Namelist {
  141.     char *name;
  142.     Vardesc **vars;
  143.     int nvars;
  144.     };
  145. typedef struct Namelist Namelist;
  146.  
  147. #define abs(x) ((x) >= 0 ? (x) : -(x))
  148. #define dabs(x) (doublereal)abs(x)
  149. #define min(a,b) ((a) <= (b) ? (a) : (b))
  150. #define max(a,b) ((a) >= (b) ? (a) : (b))
  151. #define dmin(a,b) (doublereal)min(a,b)
  152. #define dmax(a,b) (doublereal)max(a,b)
  153.  
  154. /* procedure parameter types for -A and -C++ */
  155.  
  156. #define F2C_proc_par_types 1
  157. #ifdef __cplusplus
  158. typedef int /* Unknown procedure type */ (*U_fp)(...);
  159. typedef shortint (*J_fp)(...);
  160. typedef integer (*I_fp)(...);
  161. typedef real (*R_fp)(...);
  162. typedef doublereal (*D_fp)(...), (*E_fp)(...);
  163. typedef /* Complex */ VOID (*C_fp)(...);
  164. typedef /* Double Complex */ VOID (*Z_fp)(...);
  165. typedef logical (*L_fp)(...);
  166. typedef shortlogical (*K_fp)(...);
  167. typedef /* Character */ VOID (*H_fp)(...);
  168. typedef /* Subroutine */ int (*S_fp)(...);
  169. #else
  170. typedef int /* Unknown procedure type */ (*U_fp)();
  171. typedef shortint (*J_fp)();
  172. typedef integer (*I_fp)();
  173. typedef real (*R_fp)();
  174. typedef doublereal (*D_fp)(), (*E_fp)();
  175. typedef /* Complex */ VOID (*C_fp)();
  176. typedef /* Double Complex */ VOID (*Z_fp)();
  177. typedef logical (*L_fp)();
  178. typedef shortlogical (*K_fp)();
  179. typedef /* Character */ VOID (*H_fp)();
  180. typedef /* Subroutine */ int (*S_fp)();
  181. #endif
  182. /* E_fp is for real functions when -R is not specified */
  183. /*typedef VOID C_f;    /* complex function */
  184. /*typedef VOID H_f;    /* character function */
  185. /*typedef VOID Z_f;    /* double complex function */
  186. typedef doublereal E_f;    /* real function with -R not specified */
  187.  
  188. /* undef any lower-case symbols that your C compiler predefines, e.g.: */
  189.  
  190. #ifndef Skip_f2c_Undefs
  191. #undef cray
  192. #undef gcos
  193. #undef mc68010
  194. #undef mc68020
  195. #undef mips
  196. #undef pdp11
  197. #undef sgi
  198. #undef sparc
  199. #undef sun
  200. #undef sun2
  201. #undef sun3
  202. #undef sun4
  203. #undef u370
  204. #undef u3b
  205. #undef u3b2
  206. #undef u3b5
  207. #undef unix
  208. #undef vax
  209. #endif
  210. #endif
  211.